-
Notifications
You must be signed in to change notification settings - Fork 402
docs(repo): Generate all params and return types (hooks work) #6901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: f5a92f9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughExports and documents multiple previously internal TypeScript types across React hooks and components, adds JSDoc comments, introduces a Typedoc extraction script that splits "Returns" and "Parameters" sections into separate MDX files, updates Typedoc entry points and link mappings, and integrates the extraction step into the docs generation script. No runtime behavior changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant TD as TypeDoc
participant Script as extract-returns-and-params.mjs
participant FS as Filesystem (MDX)
participant Final as Final docs (.typedoc/docs)
TD->>FS: generate initial MDX files
TD->>Script: invoke extraction script
Script->>FS: scan MDX files (exclude -return|-params|-props)
alt "## Returns" found
Script->>Script: extract Returns section
Script->>FS: write <file>-return.mdx
end
alt "## Parameters" found
Script->>Script: extract Parameters section
Script->>Script: replace generic param table patterns
Script->>FS: write <file>-params.mdx
Script->>FS: remove stale -props.mdx (if present)
end
Script->>TD: log counts
TD->>Final: assemble final docs (cpy & cleanup)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (30)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/shared/src/react/hooks/useReverification.ts (1)
14-16: Remove empty JSDoc comment.This empty JSDoc block adds no value. Per past review feedback, these were marked for cleanup but remain in the code.
Apply this diff:
-/** - * - */ async function resolveResult<T>(result: Promise<T> | T): Promise<T | ReturnType<typeof reverificationError>> {
♻️ Duplicate comments (1)
packages/shared/src/react/hooks/useReverification.ts (1)
101-107: Remove empty JSDoc comments.Multiple empty JSDoc blocks (lines 101-103, 105-107) add no value. Per past review feedback, these were marked for cleanup but remain in the code.
Apply this diff:
-/** - * - */ function createReverificationHandler(params: CreateReverificationHandlerParams) { - /** - * - */ function assertReverification<Fetcher extends (...args: any[]) => Promise<any> | undefined>(
🧹 Nitpick comments (1)
packages/shared/src/react/hooks/useReverification.ts (1)
40-53: Considerreadonlyand optional property syntax for type safety.The JSDoc documentation is accurate. For improved type safety and TypeScript best practices:
- Mark callback fields as
readonlyto prevent reassignment- Use optional syntax
level?: SessionVerificationLevelinstead of| undefinedfor clarityApply this diff:
export type NeedsReverificationParameters = { /** * Marks the reverification process as cancelled and rejects the original request. */ - cancel: () => void; + readonly cancel: () => void; /** * Marks the reverification process as complete and retries the original request. */ - complete: () => void; + readonly complete: () => void; /** * The verification level required for the reverification process. */ - level: SessionVerificationLevel | undefined; + readonly level?: SessionVerificationLevel; };
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
packages/shared/src/react/hooks/useReverification.ts(3 hunks)packages/shared/src/react/hooks/useSubscription.tsx(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/shared/src/react/hooks/useSubscription.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/shared/src/react/hooks/useReverification.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/shared/src/react/hooks/useReverification.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/shared/src/react/hooks/useReverification.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/shared/src/react/hooks/useReverification.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details
Useprotectedfor inheritance hierarchies
Usepublicexplicitly for clarity in public APIs
Preferreadonlyfor properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertionsfor literal types:as const
Usesatisfiesoperator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noanytypes without justification
Proper error handling with typed errors
Consistent use ofreadonlyfor immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/shared/src/react/hooks/useReverification.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/shared/src/react/hooks/useReverification.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/shared/src/react/hooks/useReverification.ts (2)
60-70: LGTM!The JSDoc documentation for
UseReverificationOptionscorrectly describes thepropertiesobject with nested parameter documentation. This should generate accurate TypeDoc output.
82-94: Inline JSDoc is clear and the| undefinedconstraint is correct.The
| undefinedin the Fetcher constraint intentionally allows fetchers whose return types can bePromise<X> | undefineddue to optional chaining (e.g.,() => user?.createTOTP()). This pattern is used throughout the codebase. TheresolveResultfunction properly handles undefined returns since it acceptsPromise<T> | T. The inline JSDoc for both parameters is clear and follows the established documentation style.
|
Blocked for now as waiting for this to go out: clerk/clerk-docs#2756 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/shared/src/react/hooks/useSubscription.types.ts (1)
3-19: LGTM! Clear and complete parameter documentation.The JSDoc documentation for
UseSubscriptionParamsis well-structured with accurate field descriptions and properly specified default values. This will generate excellent TypeDoc output for developers.Optional enhancement: Consider adding a brief description of the type itself before the
@interfacetag to provide additional context in the generated documentation:/** + * Configuration options for the useSubscription hook. + * * @interface */
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
.typedoc/custom-plugin.mjs(3 hunks)packages/shared/src/react/contexts.tsx(1 hunks)packages/shared/src/react/hooks/useSubscription.types.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- .typedoc/custom-plugin.mjs
- packages/shared/src/react/contexts.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/shared/src/react/hooks/useSubscription.types.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/shared/src/react/hooks/useSubscription.types.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/shared/src/react/hooks/useSubscription.types.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/shared/src/react/hooks/useSubscription.types.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details
Useprotectedfor inheritance hierarchies
Usepublicexplicitly for clarity in public APIs
Preferreadonlyfor properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertionsfor literal types:as const
Usesatisfiesoperator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noanytypes without justification
Proper error handling with typed errors
Consistent use ofreadonlyfor immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/shared/src/react/hooks/useSubscription.types.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/shared/src/react/hooks/useSubscription.types.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Build Packages
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/shared/src/react/hooks/useSubscription.types.ts (1)
21-45: Excellent return type documentation with clear field descriptions.The JSDoc for
SubscriptionResult<TData>provides comprehensive documentation for each field:
- The
datafield clearly describes all three possible states- The
errorfield correctly usesunknowntype per coding guidelines- The distinction between
isLoadingandisFetchingis well-explained- The updated
revalidatedescription is more precise and developer-friendlyThe return type
Promise<void> | voidforrevalidateappropriately handles both synchronous and asynchronous execution patterns.
…r more robust script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.typedoc/extract-returns-and-params.mjs (2)
14-45: Consider extracting magic numbers for clarity.The logic correctly extracts the Returns section and writes it alongside the source file. However, the magic number
10at line 25 (and13at line 91) represents the length of the heading strings and could be made clearer.function extractReturnsSection(filePath) { const content = fs.readFileSync(filePath, 'utf-8'); + const returnsHeading = '## Returns'; // Find the "## Returns" section - const returnsStart = content.indexOf('## Returns'); + const returnsStart = content.indexOf(returnsHeading); if (returnsStart === -1) { return false; // No Returns section found } // Find the next heading after "## Returns" (or end of file) - const afterReturns = content.slice(returnsStart + 10); // Skip past "## Returns" + const afterReturns = content.slice(returnsStart + returnsHeading.length);Apply a similar pattern to
extractParametersSectionat line 91.
52-59: Consider making type replacements configurable.The function hardcodes a single type expansion for
Fetcher. If additional types require similar expansion in the future, this approach will require code changes for each new type.Consider using a configuration map:
const TYPE_REPLACEMENTS = { 'Fetcher': 'Fetcher extends (...args: any[]) => Promise<any>', // Add more types here as needed }; function replaceGenericTypesInParamsTable(content) { let result = content; for (const [shortType, expandedType] of Object.entries(TYPE_REPLACEMENTS)) { const pattern = new RegExp(`(\\|\\s*\`\\w+\`\\s*\\|\\s*)\`${shortType}\`(\\s*\\|)`, 'g'); result = result.replace(pattern, `$1\`${expandedType}\`$2`); } return result; }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.typedoc/extract-returns-and-params.mjs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
.typedoc/extract-returns-and-params.mjs (3)
1-8: LGTM!The ESM setup with TypeScript checking and standard Node.js imports is appropriate for this build script.
117-143: LGTM!The recursive file collection correctly filters out generated files and handles missing directories gracefully.
148-150: Verify single-package scope is intentional.The script currently processes only
clerk-react, though the loop structure supports multiple packages. Confirm this limitation aligns with the PR's current scope.If additional packages need Returns/Parameters extraction in the future, simply add them to the array:
const packages = ['clerk-react', 'clerk-nextjs', ...];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/shared/src/types/clerk.ts (1)
82-84: LGTM! Inline annotation added for Typedoc processing.The
@inlineannotation is appropriate here and consistent with similar types in this file (e.g.,SDKMetadata,SignOut,ClerkStatus). This will help Typedoc inline theCheckoutResulttype definition where it's referenced in the experimental checkout API.Optionally, consider adding a brief description to clarify the type's purpose:
/** + * Result of a checkout operation, either successful with data or failed with an error. + * * @inline */This would match the documentation pattern used for other
@inlinetypes likeSDKMetadataandRouterFn.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
.typedoc/custom-plugin.mjs(3 hunks)packages/shared/src/types/clerk.ts(1 hunks)packages/shared/typedoc.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/shared/src/types/clerk.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/shared/src/types/clerk.tspackages/shared/typedoc.json
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/shared/src/types/clerk.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/shared/src/types/clerk.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details
Useprotectedfor inheritance hierarchies
Usepublicexplicitly for clarity in public APIs
Preferreadonlyfor properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertionsfor literal types:as const
Usesatisfiesoperator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noanytypes without justification
Proper error handling with typed errors
Consistent use ofreadonlyfor immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/shared/src/types/clerk.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/shared/src/types/clerk.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (4)
packages/shared/typedoc.json (1)
3-10: Entry points verified—no changes needed.Both new Typedoc entry points exist and export the expected types (PaymentElementProviderProps, PaymentElementProps, UsePaymentElementReturn, and UseCheckoutOptions), confirming the configuration properly exposes payment and checkout types for documentation generation.
.typedoc/custom-plugin.mjs (3)
21-35: LGTM! Past issues resolved.The additions to
FILES_WITHOUT_HEADINGSlook good. I can confirm:
- The typo in
use-reverification-params.mdx(line 33) has been fixed—it now correctly uses.mdxinstead of,mdx- The duplicate
use-payment-element-return.mdxhas been removed- All 15 new entries follow the consistent naming pattern
46-47: LGTM! New link replacements are well-formed.The new
LINK_REPLACEMENTSentries follow the established patterns:
- Anchor links (
#...) for same-page sections (lines 46-47)- Full documentation paths for billing resources (lines 81-82, 86-88)
- Hook return documentation with anchor (line 92)
All paths are consistent with the existing URL structure.
Also applies to: 81-82, 86-88, 92-92
8-36: ****The original review comment incorrectly assumes that all files in
FILES_WITHOUT_HEADINGSrequire correspondingLINK_REPLACEMENTSentries. However, verification shows this is not the case.
LINK_REPLACEMENTSis a temporary solution for replacing relative links that point TO these files from other MDX documentation. The search results confirm that none of the 12 files without mappings are cross-referenced anywhere in the.typedoc/directory—they only appear in theFILES_WITHOUT_HEADINGSarray itself. Therefore, missing entries inLINK_REPLACEMENTSdo not create broken links. The code is functioning as intended.Likely an incorrect or invalid review comment.
Description
Fixes https://linear.app/clerk/issue/DOCS-10983/ensure-all-hooks-are-using-typedocs-have-code-examples-for-each.
This PR is part of a broader project aimed at adding more code examples to our hooks documentation. During project discussions, we agreed that the current structure of our hooks docs needed to be revisited. Currently, most of the hook pages are fully rendered through Typedoc, including code examples. However, adding additional examples through Typedoc would have required significant restructuring of the JavaScript repo.
To address this, we decided to:
clerk-docsfor this: https://github.com/clerk/clerk-docs/pull/2649/filesAdditionally, not all hooks currently use Typedoc. This PR also ensures that all hooks are properly configured to use Typedoc for their returns and parameters.
This PR includes:
This PR will be the first in a sequence. Once merged, we’ll proceed with its sibling PR in
clerk-docs,which:Hooks checklist
useAuth,useReverificationand the billing hooks - can be compared to what's on the live docs.How to test
In order to test this properly, you will need to do the following:
javascriptrepo, switch to the branch of this PRpnpm run typedoc:generatess/DOCS-10983npm run typedoc:link ../javascript/.typedoc/docsImportant notes/ discussion pts
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Documentation
Chores